package com.webside.file.result;

import org.springframework.data.domain.Page;

/**
 * @author airshiplay
 * 
 * @param <T>
 */
public class ResultEntity<T> {
	protected int result;
	protected String msg;
	protected int totalPageNum;
	protected int currentPageNum;
	protected T data;
	
	public ResultEntity(T data) {
		this.result = ResultCode.success;
		this.data = data;
	}
	public ResultEntity(int result, String msg) {
		this.result = result;
		this.msg = msg;
	}

	public ResultEntity(int result, T data) {
		this.result = result;
		this.data = data;
	}

	public ResultEntity(int result, String msg, T data) {
		this.result = result;
		this.msg = msg;
		this.data = data;
	}

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	

	public int getTotalPageNum() {
		return totalPageNum;
	}

	public void setTotalPageNum(int totalPageNum) {
		this.totalPageNum = totalPageNum;
	}



	public int getCurrentPageNum() {
		return currentPageNum;
	}

	public void setCurrentPageNum(int currentPageNum) {
		this.currentPageNum = currentPageNum;
	}



	public static interface ResultCode {
		public static int success = 0;
		public static int fail = -1;
		public static int LinkControlError = 403;
		public static interface User {
		public int exist = -1000;
		public int email_error = -1001;
		}
	}

}
